package com.doctor.web.controller;

import java.util.Map;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.doctor.database.model.Account;
import com.doctor.database.repository.AccountRepository;
import com.doctor.database.service.AccountService;

@Controller
public class AccountController {
	private static final Logger LOGGER = Logger
			.getLogger(AccountController.class);
	
	@Autowired
	AccountService accountService;
	
	
	@RequestMapping(value="/app_login.do")  
	@ResponseBody
	public Map login(String name ,String pwd){
		return accountService.findAccountByNameAndPwd(name, pwd);
	}
	
	@RequestMapping(value="/app_logout.do")  
	@ResponseBody
	public Map logout(String name ,String pwd){
		return accountService.findAccountByNameAndPwd(name, pwd);
	}

}
